#include <stdio.h>

int reverse(int n);
int main(void) {
	int num;
	scanf("%d", &num);
	printf("%d", reverse(num));
	return 0;
}

int reverse(int n) {
	int temp, result = 0;
	while (n > 0) {
		temp = n % 10;
		result = result * 10 + temp;
		n /= 10;
	}
	return result;
}